<!--
 * @description  : 移送变价案件追溯查询列表
 * @descriptionDetail: 移送变价案件追溯查询列表
 * @copyright    : 河北烟草
 * @author       : gys
 * @create       : 2024-06-19 08:30:00
-->

<template>
	<view class="">
		<!-- #ifdef H5-ONLY -->
		<theme-navbar :is-white="false" :custom-back="goBack" style="z-index: 99999" :title="navTitle">
		</theme-navbar>
		<!-- #endif -->
		<view class="nolicence-search-lay" :style="{ 'top': isHideNav ? 0 : '44px' }">
			<view class="nolicenSearch">
				<u-search shape="round" :clearabled="true" :showAction="true" actionText="确定" :animation="true"
					:placeholder="plTitle" v-model="searchKey" @custom="toSearchList"></u-search>
			</view>
		</view>
		<view class="content u-page">
			<me-table :i="0" :index="0" :top="10" :load-data="loadData" :height="getListViewHeight()" :init-load="false"
				ref="mescrollItem0">
				<view slot-scope="d" class="list-item-root">
					<view class="list-lay">
						<handoverListItem :itemInfo="d.data"></handoverListItem>
					</view>
				</view>
			</me-table>
		</view>
	</view>
</template>


<script>
import MescrollMoreMixin from '@/components/mescroll-uni/mixins/mescroll-more.js';
import meTable from '@/components/me-table.vue';
import handoverListItem from './handoverListItem.vue';
import storeService from '@/service/store/store.service.js';
import fabButton from '@/components/uni-fab.vue';

import {
	ESCROW_TYPE,
} from '@/service/store/mapping/enum.js';
export default {
	components: {
		meTable,
		fabButton,
		handoverListItem,
	},
	mixins: [MescrollMoreMixin,],
	data() {
		return {
			searchKey: '',
			customStyle: {
				padding: '30rpx',
			},
			user: this.$storage.get(this.$rp.common.USER),
			plTitle: '请输入案件编号'
		};
	},
	mounted() {

	},
	methods: {
		getListViewHeight() {
			let p = this.$u.sys().windowHeight - 44 - 57 - 40 - uni.upx2px(10) - this.$u.sys().statusBarHeight + 'px';
			// #ifdef H5-DINGDING || H5-WECHAT
			p = this.$u.sys().windowHeight - uni.upx2px(10) - 57 - 40 - this.$u.sys().statusBarHeight + 'px';
			// #endif
			return p;
		},
		toSearchList(e) {
			this.getMescroll(0).triggerDownScroll();
		},
		loadData(page) {
			let params = {
				page: page.num,
				limit: page.size,
				paras: {},
			};
			return new Promise((resolve, reject) => {
				params.paras.caseCode = this.searchKey;
				// params.paras.caseName = this.searchKey;
				storeService.getHandoverCaseList(params)
					.then((res) => {
						if (res.success) {
							resolve({
								count: res.count,
								data: res.data,
							});
						} else {
							resolve({
								count: 0,
								data: [],
							});
						}
					})
					.catch((e) => {
						this.$u.toast('请求失败:' + e);
						resolve({
							count: 0,
							data: [],
						});
					});
			});
		},
	},
};
</script>

<style scoped lang="scss">
// @import '@/style/common/rightMenu.scss';

page {
	background-color: #f3f4f5;
}

.content {
	background-color: #f3f4f5;
	margin-top: 52px;
}

.nolicence-search-lay {
	// background-color: #fff;
	position: fixed;
	// #ifndef H5-DINGDING
	top: 44px;
	// #endif
	// #ifdef H5-DINGDING
	top: 0px;
	// #endif
	z-index: 999;
	width: 100%;
	overflow: hidden;
	background-color: #ffffff;
	border-bottom: 1px solid $u-border-color;
}

.nolicenSearch {
	padding: $cm-search-padding-row $cm-search-padding-column;
}

.key-search {
	width: 100%;
	margin: auto;
	padding-left: 2.5%;
	padding-right: 2.5%;
	line-height: 48px;
	border-bottom: 1px solid $u-border-color;
}

.pop-content-lay {
	padding: 20rpx;
	display: flex;
	height: 100%;
	flex-direction: column;
	justify-content: center;
}

.grid-text {
	font-size: 28rpx;
	margin-top: 4rpx;
	color: $u-type-info;
}

.list-lay {
	margin: 10px;
}

.list-item-root {
	margin: 10px;
	border-radius: 15px;
	overflow: hidden;
	border-bottom: 1px solid $u-border-color;
	background-color: #fff;
}

.u-tabs__wrapper__scroll-view-wrapper {
	width: 100%;
}
</style>